{% extends "AcmeDemoBundle::award.html.twig" %} {% block javascript %}

<script type="text/javascript">
	$(function(){
		$('#year').mask('99999999', {reverse: true});
		$("#search").click(function() {
			if($("#year").val() == ""){
				alert("Xin hãy nhập năm !");
				$("#year").focus();
				return;
			}
			$("#form").attr("action", "{{ path('acme_Xetthidua_danhsach') }}");
	        $("#form").submit();
        });
		$("#button_ok").click(function() {
            $("#form").attr("action", "{{ path('acme_Xetthidua_thidua') }}");
            $("#form").submit();
        });
		
	});

</script>

{% endblock %} {% block content %}

<div class="grid_16" id="content">
<form id="form" method="post">
	<div class="grid_9">
		<h1 class="report">Xét thi đua</h1>
	</div>
	<div class="grid_16">
		
			<table width="100%">
				<tr>
					<td width="30%">Phòng ban <br/>
					<select id="phongban" name="phongban">
							 {% for
							phongban in lstphongban %}
							{% if phongban.id == phongbanid%}
							<option value="{{phongban.id}}" selected="selected">{{phongban.ten}}</option>
							{% else %}
							 <option value="{{phongban.id}}">{{phongban.ten}}</option>
							{% endif %}
							 {%
							endfor %} </td>

					<td width="40%">&nbsp; 
					</td>
				</tr>
				<tr>
				    <td> Năm <br/>
				        <input type="text" id="year" value="{{year}}" name="year">
				    </td>
				    <td> <br/><a id="search"
                        class="button_grey_round"> <span>Search</span>
                    </a></td>
				</tr>
			</table>
		
	</div>

	<div class="grid_16">
		<div class="portlet">
		  <div class="portlet-header fixed">
		      {% if co == "1" %}
		          Năm này đã xét thi đua !!!
		          <input type="hidden" name="action" value="update">
		      {% else %}
		          Năm này chưa xét thi đua !!!
		          <input type="hidden" name="action" value="insert">
		      {% endif %}
		  </div>
		  <div class="portlet-content nopadding">
			<table width="90%" cellpadding="0" cellspacing="0" id="box-table-a"
				summary="Employee Pay Sheet">
				<thead>
					<tr>
						<th width="20" scope="col">STT</th>
						<th width="200" scope="col">Tên</th>
						<th width="100" scope="col">Chức vụ</th>
						<th width="50" scope="col">Xuất sắc</th>
						<th width="50" scope="col">Tiên tiến</th>
						<th width="50" scope="col">Khá</th>
						<th width="50" scope="col">Trung bình</th>
					</tr>
				</thead>
				<tbody>
				{% if co == "1" %}
				     {% for thidua in lstThiDua %}
                    <tr>
                        <td>{{loop.index}}</td>
                        <td>{{thidua.nhanvienid.hoten}}</td>
                        <td>{{thidua.nhanvienid.chucvuid.ten}}</td>
                        {% if thidua.thiduaid.id == 5 %}
                            <td><input type="radio" value="8" name="{{thidua.nhanvienid.id}}"/></td>
	                        <td><input type="radio" value="7" name="{{thidua.nhanvienid.id}}"/></td>
	                        <td><input type="radio" value="6" name="{{thidua.nhanvienid.id}}"/></td>
	                        <td><input type="radio" value="5" checked="checked" name="{{thidua.nhanvienid.id}}"/></td>
                        {% elseif thidua.thiduaid.id == 6 %}
                            <td><input type="radio" value="8" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="7" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="6" checked="checked" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="5" name="{{thidua.nhanvienid.id}}"/></td>
                        {% elseif thidua.thiduaid.id == 7 %}
                            <td><input type="radio" value="8" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="7" checked="checked" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="6" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="5" name="{{thidua.nhanvienid.id}}"/></td>
                        {% elseif thidua.thiduaid.id == 8 %}
                            <td><input type="radio" value="8" checked="checked" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="7" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="6" name="{{thidua.nhanvienid.id}}"/></td>
                            <td><input type="radio" value="5" name="{{thidua.nhanvienid.id}}"/></td>
                        {% endif %}
                        
                    </tr>
                    {% endfor %}
				{% else %}
				    {% for nhanvien in lstNhanVien %}
					<tr>
						<td>{{loop.index}}</td>
						<td>{{nhanvien.hoten}}</td>
						<td>{{nhanvien.chucvuid.ten}}</td>
						<td><input type="radio" value="8" name="{{nhanvien.id}}"/></td>
						<td><input type="radio" value="7" checked="checked" name="{{nhanvien.id}}"/></td>
						<td><input type="radio" value="6" name="{{nhanvien.id}}"/></td>
						<td><input type="radio" value="5" name="{{nhanvien.id}}"/></td>
					</tr>
					{% endfor %}
				{% endif %}
				</tbody>
			</table>
			</div>
        </div>
	</div>
	<div class="grid_16">
	<a
            class="button_ok" id="button_ok"> <span>Xét thi đua</span>
        </a> 
        </div>
	</form>
</div>
{% endblock %}
